/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ruben
 */
@Entity
@Table(name = "palabraclave", catalog = "iluscode", schema = "", uniqueConstraints = {
    @UniqueConstraint(columnNames = {"codigo"})})
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Palabraclave.findAll", query = "SELECT p FROM Palabraclave p"),
    @NamedQuery(name = "Palabraclave.findByCodigo", query = "SELECT p FROM Palabraclave p WHERE p.codigo = :codigo"),
    @NamedQuery(name = "Palabraclave.findByValor", query = "SELECT p FROM Palabraclave p WHERE p.valor = :valor"),
    @NamedQuery(name = "Palabraclave.findByTipotoken", query = "SELECT p FROM Palabraclave p WHERE p.tipotoken = :tipotoken")})
public class Palabraclave implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "codigo", nullable = false)
    private Integer codigo;
    @Size(max = 45)
    @Column(name = "valor", length = 45)
    private String valor;
    @Size(max = 45)
    @Column(name = "tipotoken", length = 45)
    private String tipotoken;

    public Palabraclave() {
    }

    public Palabraclave(Integer codigo) {
        this.codigo = codigo;
    }

    public Integer getCodigo() {
        return codigo;
    }

    public void setCodigo(Integer codigo) {
        this.codigo = codigo;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String valor) {
        this.valor = valor;
    }

    public String getTipotoken() {
        return tipotoken;
    }

    public void setTipotoken(String tipotoken) {
        this.tipotoken = tipotoken;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Palabraclave)) {
            return false;
        }
        Palabraclave other = (Palabraclave) object;
        if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Palabraclave[ codigo=" + codigo + " ]";
    }
    
}
